<?php 
$user=$session->read('User');
$companyid=$session->read("companyid");
$isflag=$action->checkPermissions($user,$companyid);
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
    	<h2>
		<?php 
		$companyname=$session->read("companyname");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		?>
    	</h2>
    	<div class='clear'></div>
    </div>
    <div class="right item_add_btn">
		<?php 
			if($form->value('CompInstitution.id')){
			$str_title=__("Edit",true);
			}else{
			$str_title=__("Add",true);
			}
    		echo $html->link(__("Cancel",true).$str_title,"/companys/depcosts/");
    	?>
	</div>
    <div class="clear"></div>
</div>
<?php echo $form->create('Company', array('url' => "/companys/editstitution",'id'=>'patentform','enctype'=>'multipart/form-data','onsubmit'=>"return checksave()"));?>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="details_item_line">
			<div class="details_item">
				<div class="form_left_title left">机构名称：</div>
					<div class="form_right_e_input left">
					<?php echo $form->text('CompInstitution.institution_name',array("maxlength"=>"100","style"=>"width:147px"));?>
					</div>
				<div id='institutionnamememessage' style='display:none;' class="error_message">请填写名称</div>
			</div>
		</div>
		<div class="details_item_line">
			<div class="details_item">
				<div class="form_left_title left"><?php echo "备注" ;?>：</div>
				<div class="form_right_e_input left"><?php echo $form->textarea('CompInstitution.remark');?></div>	    
			</div>
		</div>
		<?php 
			echo $form->hidden('CompInstitution.cid',array('value' => $companyid)) ;
			echo $form->hidden('CompInstitution.id') ;
		?>
		<div class="details_item_line">
			<div class="details_item">
				<div class="form_left_title left"></div>
				<div class="form_add_submit left">
				<?php echo $form->submit(__('Save',true), array("id"=>"adduser","name"=>"submit","class"=>"buttom","div"=>false));?>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
function checksave(){	
	if($("#CompInstitutionInstitutionName").val().trim() == ''){
		$("#institutionnamememessage").css('display','block');
		return false;
	}else{
		$("#institutionnamememessage").css('display','none');
	}	  
}	
</script>
